v
<template>
  <div class="login">
    <div class="login-mobu">
      <div class="login-form">
        <div class="login-title">诚通证券-信用业务数字化系统</div>
        <el-form ref="form" :model="form" label-width="100px" :rules="rules">
          <el-form-item prop="name">
            <el-input v-model="form.name" placeholder="请输入用户名"></el-input>
          </el-form-item>
          <el-form-item prop="password">
            <el-input
              v-model="form.password"
              placeholder="请输入密码"
            ></el-input>
          </el-form-item>
          <div class="login-btn" @click="login">登录</div>
        </el-form>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "NotFound",
  data() {
    return {
      form: {
        password: "",
        name: "",
      },
      rules: {
        name: [
          { required: true, message: "用户名不可以为空", trigger: "change" },
        ],
        password: [
          { required: true, message: "密码不可以为空", trigger: "change" },
        ],
      },
    };
  },
  methods: {
    login() {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          if (this.$route.path !== "/layout") {
            this.$router.push("/layout");
          }
        } else {
          return false;
        }
      });
    },
  },
};
</script>

<style lang="less" scoped>
.login {
  display: flex;
  align-items: center;
  justify-content: center;
  background: url("@/assets/bg.jpg");
  background-size: cover;
  background-repeat: no-repeat;
  height: 100%;

  backdrop-filter: blur(3px);
  .login-form {
    padding: 20px 50px;
    width: 800px;
    height: 400px;
    display: flex;
    flex-direction: column;
    row-gap: 80px;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 10px;
    box-shadow: 0 0 30px 10px rgba(0, 0, 0, 0.3);
    .login-title {
      font-size: 40px;
      font-weight: bold;
      font-family: cursive;
    }
    .login-btn {
      width: 100%;
      height: 50px;
      line-height: 50px;
      margin-top: 40px;
      letter-spacing: 10px;
      background-color: #bf0000;
      color: #fff;
      font-size: 28px;
      font-weight: bold;
      border-radius: 10px;
      cursor: pointer;
      &:hover {
        background-color: #ef2020;
      }
    }
    ::v-deep .el-form-item__label {
      font-size: 20px;
      color: #fff;
    }
    ::v-deep .el-input__inner {
      width: 400px;
    }
    ::v-deep .el-form-item__content {
      margin: 0 !important;
    }
    ::v-deep .el-form-item__error {
      font-size: 12px;
      background: #ffffffc2;
      padding: 1px 2px;
      border-radius: 3px;
    }
  }
}
</style>
